function not(f) {
  function resultF(...args) {
    return !f(...args);
  }
  return resultF;
}

function f1(x, y) {
  return (x + y) % 2 === 0;
}
function f2(x) {
  return x > 5;
}
const notF1 = not(f1);
const notF2 = not(f2);
console.log(f1(3, 5)); // true
console.log(notF1(3, 5)); // false
console.log(f2(3)); // false
console.log(notF2(3)); // true
